package com.cam.test;

import com.cameron.serviceedu.entity.EduChapter;
import com.cameron.serviceedu.entity.EduCourse;
import com.cameron.serviceedu.entity.EduSubject;
import com.cameron.serviceedu.entity.dto.front.CourseDto;
import com.cameron.serviceedu.entity.dto.front.SubjectDto;
import com.cameron.serviceedu.service.EduChapterService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.BeanUtils;
import org.springframework.context.annotation.Bean;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.Date;


public class Man {
    private double weight;
    public void setWeight(double weight) {
        this.weight = new BigDecimal(weight)
                .setScale(2, RoundingMode.DOWN).doubleValue();
    }

    public double getWeight() {
        return weight;
    }
    @Resource
    private EduChapterService chapterService;



    public void test(){
        EduChapter chapter = new EduChapter();
        chapter.setCourseId("1291590342465843201");
        chapter.setTitle("what is love");
        chapter.setSort(2);
        chapter.setGmtCreate(new Date());
        chapter.setGmtCreate(new Date());
        chapterService.save(chapter);
     }
}
